<?php
// require 'MysqlDb.class.php';
// require 'Factory.class.php';
// require 'Model.class.php';
// require 'MatchController.class.php';
// require 'MatchModel.class.php';
// require 'TeamController.class.php';
// require 'TeamModel.class.php';

$map = array(
    'MysqlDb' => './freamwork/MysqlDb.class.php',
    'Factory' => './freamwork/Factory.class.php',
    'Model'   => './freamwork/Model.class.php',
    'Smarty' => './freamwork/lib/smarty/Smarty.class.php',
    // 'MatchController' => './app/Home/controller/MatchController.class.php',
    // 'TeamController' => './app/Home/controller/TeamController.class.php',
    // 'MatchModel' =>'./app/Home/model/MatchModel.class.php',
    // 'TeamModel' =>'./app/Home/model/TeamModel.class.php',
);
function __autoload($ClassName){
    

   global $map;

    if(isset($map[$ClassName])){

      require $map[$ClassName];

    }
     elseif('Controller'==substr($ClassName,-10)){

     	require './app/Home/controller/'.$ClassName.'.class.php';
     }
     elseif('Model'==substr($ClassName,-5)){
     	require './app/Home/model/'.$ClassName.'.class.php';
     	var_dump($ClassName);
     }

}









$controllerName = isset($_GET['c']) ? $_GET['c'] : 'Match'; //控制器名
$methodName     = isset($_GET['a']) ? $_GET['a'] : 'matchList'; //方法名

$controller = $controllerName . 'Controller';
// var_dump($controller, $methodName);

$c = new $controller();
$c->$methodName();

// var_dump($controllerName,$controller);

//类文件controller代表

//实例化类文件
